<!doctype html>
<script>
onload = function () {
    var testElement = document.querySelector('#test');
    var i=0;
    testElement.addEventListener('DOMSubtreeModified', function() { i++; });
    testElement.textContent = "new";
    document.body.textContent = (i == 1) ? "PASS" : "FAIL: i=" + i;
}
</script>
<div id="test">old</div>
